home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / netBoot / h / map.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-05-13  |  1.5 KB  |  38 lines

  1. /*    @(#)map.h 1.1 86/09/27 SMI; from UCB 4.7 81/11/08    */
  2.  
  3.  
  4. /*
  5.  * Resource Allocation Maps.
  6.  *
  7.  * Associated routines manage sub-allocation of an address space using
  8.  * an array of segment descriptors.  The first element of this array
  9.  * is a map structure, describing the arrays extent and the name
  10.  * of the controlled object.  Each additional structure represents
  11.  * a free segment of the address space.
  12.  *
  13.  * A call to rminit initializes a resource map and may also be used
  14.  * to free some address space for the map.  Subsequent calls to rmalloc
  15.  * and rmfree allocate and free space in the resource map.  If the resource
  16.  * map becomes too fragmented to be described in the available space,
  17.  * then some of the resource is discarded.  This may lead to critical
  18.  * shortages, but is better than not checking (as the previous versions
  19.  * of these routines did) or giving up and calling panic().  The routines
  20.  * could use linked lists and call a memory allocator when they run
  21.  * out of space, but that would not solve the out of space problem when
  22.  * called at interrupt time.
  23.  *
  24.  * N.B.: The address 0 in the resource address space is not available
  25.  * as it is used internally by the resource map routines.
  26.  */
  27. struct map {
  28.     struct    mapent *m_limit;    /* address of last slot in map */
  29.     char    *m_name;        /* name of resource */
  30. /* we use m_name when the map overflows, in warning messages */
  31. };
  32. struct mapent
  33. {
  34.     int    m_size;        /* size of this segment of the map */
  35.     int    m_addr;        /* resource-space addr of start of segment */
  36. };
  37.  
  38.